/* LLM Panel Component Styles - 极简风格 */
.llm-panel {
  position: fixed;
  top: 80px; /* 考虑顶部导航栏高度 */
  right: 20px;
  width: 380px;
  height: calc(100vh - 100px); /* 考虑上下边距 */
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.llm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #0a0a0a; /* 与主背景保持一致 */
  flex-shrink: 0;
}

.llm-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.llm-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.llm-brand {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.llm-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a0a0a; /* 与主背景保持一致 */
}

.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}

.star-icon {
  position: relative;
  margin-bottom: 40px;
}

.star-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.2) 50%, transparent 70%);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.star-core {
  position: relative;
  font-size: 64px;
  z-index: 1;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

.welcome-text h2 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.welcome-text p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.llm-messages::-webkit-scrollbar {
  width: 4px;
}

.llm-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.llm-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.welcome-message {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.8);
}

.welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.welcome-message h4 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.welcome-message p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px 0;
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggestion-btn {
  background: rgba(0, 202, 224, 0.1);
  border: 1px solid rgba(0, 202, 224, 0.3);
  color: #00cae0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.suggestion-btn:hover {
  background: rgba(0, 202, 224, 0.2);
  border-color: rgba(0, 202, 224, 0.5);
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: rgba(0, 202, 224, 0.2);
}

.message.ai .message-avatar {
  background: rgba(184, 221, 255, 0.1);
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message.user .message-content {
  text-align: right;
}

.message-text {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #ffffff;
  word-wrap: break-word;
}

.message.user .message-text {
  background: rgba(0, 202, 224, 0.2);
  color: #ffffff;
}

.message-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #00cae0;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.llm-input {
  padding: 20px 24px;
  /* border-top: 1px solid rgba(255, 255, 255, 0.1); */
  background: #0a0a0a; /* 与主背景保持一致 */
  flex-shrink: 0;
}

.input-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.message-input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
  height: 44px;
}

.message-input:focus {
  border-color: rgba(102, 126, 234, 0.5);
  background: #333;
}

.message-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.llm-send-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff; /* 改为纯白色，更明显 */
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.llm-send-btn:hover:not(:disabled) {
  background: #333;
  border-color: rgba(102, 126, 234, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.llm-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  color: rgba(255, 255, 255, 0.4);
}



/* 小屏幕调整 LLM 面板 */
@media (max-width: 1380px) {
  .llm-panel {
    width: 100%;
    height: 100vh;
    top: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }
}

@media (max-width: 768px) {
  .llm-panel {
    width: 100%;
    height: 100vh;
    top: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }
  
  .welcome-text h2 {
    font-size: 20px;
  }
  
  .welcome-text p {
    font-size: 14px;
  }
  
  .star-core {
    font-size: 48px;
  }
  
  .star-glow {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  .llm-header {
    padding: 12px;
  }
  
  .llm-messages {
    padding: 12px;
  }
  
  .llm-input {
    padding: 12px;
  }
  
  .input-container {
    gap: 8px;
  }
  
  .message-input {
    font-size: 13px;
    padding: 10px 12px;
  }
  
  .llm-send-btn {
    /* 移除固定宽高，让按钮自适应内容 */
  }
}
